<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Correição</h2>
            <p:panel styleClass="container_24 clearfix "  style="background: none; border: none;">
                <h:form id="form" acceptcharset="utf-8" >
                    <p:growl id="msg" life="3000" />

                    <div class="grid_5">
                        <p:menu >  
                            <p:submenu label="Menu">  
                                <p:menuitem value="Novo" style="font-size: 13px;" 
                                            actionListener="#{managerRedirect.redirect('createEyre.xhtml')}" 
                                            update="@form"  icon="ui-icon-circle-plus" />  

                                <p:menuitem value="Pesquisar"  style="font-size: 13px;" actionListener="#{managerRedirect.redirect('searchEyre.xhtml')}" update="@form" icon="ui-icon-circle-zoomout"/>  
                                <p:menuitem value="Finalizados"  style="font-size: 13px;" actionListener="#{managerRedirect.redirect('viewDetermination.xhtml')}" update="@form" icon="ui-icon-circle-check"/>
                                <p:menuitem value="Edital"  style="font-size: 13px;" actionListener="#{managerRedirect.redirect('edict.xhtml')}" update="@form" icon="ui-icon-clipboard"/> 
                                <p:menuitem value="Determinações Pendentes"  style="font-size: 13px;" actionListener="#{managerRedirect.redirect('closeDetermination.xhtml')}" update="@form" icon="ui-icon-note"/>   

                            </p:submenu>
                        </p:menu>
                    </div>
                    <div class="grid_18">
                        <p class="subtitle">Correição Atual</p>
                        <p:dataTable value="#{managerSearcheQuestionnaireResponse.lstQuestionnaireResponseDate()}"
                                     var="q"  paginator="true" rows="5" style="width:100%;" 
                                     paginatorPosition="bottom"
                                     emptyMessage="Nenhuma Correição encontrada"
                                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                     rowsPerPageTemplate="5,10,15"
                                     >
                            <f:facet name="header">
                                Correição - 
                                <h:outputText value="#{managerSearcheQuestionnaireResponse.questionnaireResponseDate.dateQ}">
                                    <f:convertDateTime pattern="dd/MM/yyyy"/>
                                </h:outputText>
                            </f:facet>  
                            <p:column headerText="Executor">
                                <p:outputLabel value="#{q.executor.name}"/>
                            </p:column>
                            <p:column headerText="Cartório">
                                <p:outputLabel value="#{q.notaryOffice.nome}"/>
                            </p:column>
                            <p:column headerText="Opções" style="font-size: 12px; width: 20px;">
                                <p:commandButton icon="ui-icon-circle-zoomin" title="Visualizar Correição"
                                                 actionListener="#{managerSearcheQuestionnaireResponse.informacao(q)}" onclick="dialog.show()" 
                                                 update=":form:dialogPanel"/>
                                <!--<p:commandButton icon="ui-icon-play" title="Dados da Correição" actionListener="{managerEditQuestionnaireResponse.viewIssues(q)}" update="@form"/>-->
                            </p:column>
                        </p:dataTable>    
                    </div>


                    <div class="grid_9">
                        <p class="subtitle">Próximas Correições</p>

                        <p:dataTable var="q" value="#{managerSearcheQuestionnaireResponse.lstQuestionnaireResponseNext()}"
                                     paginator="true" rows="3" style="width:100%;"
                                     paginatorPosition="bottom"
                                     emptyMessage="Nenhuma Correição encontrada"
                                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                     rowsPerPageTemplate="5,10,15">
                            <f:facet name="header">
                                Correição
                            </f:facet>  

                            <p:column headerText="Cartório">
                                <p:outputLabel value="#{q.notaryOffice.nome}"/>
                            </p:column>
                            <p:column headerText="Opções" style="font-size: 12px; width: 20px;">
                                <p:commandButton icon="ui-icon-circle-zoomin" title="Visualizar Correição"  
                                                 actionListener="#{managerSearcheQuestionnaireResponse.informacao(q)}"  onclick="dialog.show()"
                                                 update=":form:dialogPanel"/>
                            </p:column>

                        </p:dataTable>   
                    </div>
                    <div class="grid_9">
                        <p class="subtitle">Correições Pendentes</p>
                        <p:dataTable var="q" value="#{managerSearcheQuestionnaireResponse.lstQuestionnaireResponsePending()}"
                                     paginator="true" rows="3" style="width:100%;"
                                     paginatorPosition="bottom"
                                     emptyMessage="Nenhuma Correição encontrada"
                                     paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                                     rowsPerPageTemplate="5,10,15">
                            <f:facet name="header">
                                Correição
                            </f:facet>  
                            <p:column headerText="Cartório">
                                <p:outputLabel value="#{q.notaryOffice.nome}"/>
                            </p:column>
                            <p:column headerText="Opções" style="font-size: 12px;">
                                <p:commandButton icon="ui-icon-circle-zoomin" title="Visualizar Correição"
                                                 actionListener="#{managerSearcheQuestionnaireResponse.informacao(q)}"
                                                 onclick="dialog.show()" update=":form:dialogPanel" style="width:50%;"/>
                            </p:column>
                        </p:dataTable>    
                    </div>


                    <p:dialog id="dialog" showHeader="true" modal="true"
                              showEffect="explode"  width="30%"
                              widgetVar="dialog" header="Informação" style="background: #F1F2E9; ">

                        <h:panelGrid  id="dialogPanel" columns="2" style="font-size: 12px; width: 100%">

                            <p:outputLabel value="Data: " style="float: right; color: #000000; font-weight: bold" />   
                            <h:outputText  value="#{managerSearcheQuestionnaireResponse.questionnaireResponse.dateQ}">
                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                            </h:outputText>
                            <p:outputLabel value="Executor: " style="float: right; color: #000000; font-weight: bold" />   
                            <p:outputLabel value="#{managerSearcheQuestionnaireResponse.questionnaireResponse.executor.name}"/>
                            <p:outputLabel value="Cartório: " style="float: right; color: #000000; font-weight: bold"/>   
                            <p:outputLabel value="#{managerSearcheQuestionnaireResponse.questionnaireResponse.notaryOffice.nome}"/>   
                            <p:outputLabel value="Localidade: " style="float: right; color: #000000; font-weight: bold"/>   
                            <p:outputLabel value="#{managerSearcheQuestionnaireResponse.questionnaireResponse.notaryOffice.address.city.name} - #{managerSearcheQuestionnaireResponse.questionnaireResponse.notaryOffice.address.city.states.sgl} "/>   

                        </h:panelGrid>
                        <br/>
                        <center>
                            <p:commandButton value="Cancelar" style="font-size: 12px;" onclick="dialog.hide();"/>
                        </center>
                    </p:dialog>

                </h:form>
            </p:panel>
        </ui:define>
    </ui:composition>

</html>



